package xyz.eden.cloud.common.core.exception;

import lombok.Getter;
import xyz.eden.cloud.common.core.result.ResultSetEnum;

/**
 * 系统异常
 */
@Getter
public class ServiceException extends RuntimeException {

    protected Integer code;
    protected String message;

    public ServiceException(String message) {
        super(message);
        this.code = ResultSetEnum.ERROR_SYSTEM.getCode();
        this.message = message;
    }

    public ServiceException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
        this.code = ResultSetEnum.ERROR_SYSTEM.getCode();
        this.message = message;
    }

    public ServiceException(Integer code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }
}
